﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Db.SysDb
{
    /// <summary>
    /// 报警信息  记录温度报警和设备报警
    /// </summary>
    [SugarTable("alarm", TableDescription = "报警信息")]
    public class Alarm
    {
        /// <summary>
        /// 主键 自增Id
        /// </summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 报警种类
        /// </summary>           
        [SugarColumn(ColumnName = "alarm_type", Length = 64, IsNullable = false, ColumnDescription = "报警种类")]
        public string AlarmType { get; set; }

        /// <summary>
        /// 报警信息
        /// </summary>
        [SugarColumn(ColumnName = "alarm_message", Length = 256, IsNullable = false, ColumnDescription = "报警信息")]
        public string AlarmMessage { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        [SugarColumn(ColumnName = "start_time", IsNullable = true, ColumnDescription = "开始时间")]
        public DateTime? StartTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 持续时间
        /// </summary>
        [SugarColumn(ColumnName = "time", IsNullable = true, ColumnDescription = "持续时间")]
        public string Time { get; set; } = "";
        /// <summary>
        /// 设备号
        /// </summary>
        [SugarColumn(ColumnName = "equipment_number", Length = 64, IsNullable = true, ColumnDescription = "设备号")]
        public string EquipmentNumber { get; set; } = string.Empty;
    }
}
